import * as types from '../types'

const state = {
  nodeList:null,
  page:1,
  node:null
}

const mutations = {

  [types.NODELIST_RESET] (state, {data}) {
    state.nodeList = data;
  },

  [types.NODELIST_ADD] (state, {data}) {
    state.nodeList = state.nodeList.concat(data)
  },

  [types.NODE_RESET] (state, {data}) {
    state.node = data
  },

  [types.PAGE_SET] (state, {data}) {
    console.log(data)
    state.page = data;
  }
}

export default {
  state,
  mutations
}